﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using DiagnosticCenter.Web;

namespace DiagnosticCenter.View
{
    public partial class viewOperatorTestManager : Page
    {
        public viewOperatorTestManager()
        {
            InitializeComponent();

            var ctx = new DatabaseContext();
            //var groupid = Convert.ToInt32(WebContext.Current.User.GroupID);

            gridTests.ItemsSource = ctx.tblTests;
            ctx.Load(ctx.GetTblTestsQuery());

        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void buttonTestAdd_Click(object sender, RoutedEventArgs e)
        {
            //Application.LoadComponent(this, new Uri("/View/viewOperator.xaml", UriKind.Relative));
            //FrameworkElement fe = (MainPage)Application.Current.RootVisual;
            //var mp = (viewOperator)fe.FindName("viewOperator");
            //var mp = (Grid) fe.FindName("LayoutRoot");
            //mp.
           // var mp = (viewOperator)Application.Current.RootVisual;
            var mp = (MainPage)Application.Current.RootVisual;
            mp.mainFrame.Navigate(new Uri("/View/viewOperatorTestEdit.xaml", UriKind.Relative));
        }

    }
}